package com.etc.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
    * 用户表
    */
public class User {
    private Long id;

    /**
    * 用户名
    */
    private String username;

    /**
    * 密码，加密存储
    */
    private String password;

    /**
    * 注册手机号
    */
    private String phone;

    /**
    * 注册邮箱
    */
    private String email;

    /**
    * 创建时间
    */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
    * 修改时间
    */
    private Date updateTime;

    /**
    * 会员来源：1:PC，2：H5，3：Android，4：IOS，5：WeChat
    */
    private String sourceType;

    /**
    * 昵称
    */
    private String nickName;

    /**
    * 真实姓名
    */
    private String name;

    /**
    * 使用状态（Y正常 N非正常）
    */
    private String status;

    /**
    * 头像地址
    */
    private String headPic;

    /**
    * QQ号码
    */
    private String qq;

    /**
    * 账户余额
    */
    private Long accountBalance;

    /**
    * 手机是否验证 （0否  1是）
    */
    private String isMobileCheck;

    /**
    * 邮箱是否检测（0否  1是）
    */
    private String isEmailCheck;

    /**
    * 性别，1男，2女
    */
    private String sex;

    /**
    * 会员等级
    */
    private Integer userLevel;

    /**
    * 积分
    */
    private Integer points;

    /**
    * 经验值
    */
    private Integer experienceValue;

    /**
    * 生日
    */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
    * 最后登录时间
    */
    private Date lastLoginTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getSourceType() {
        return sourceType;
    }

    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public Long getAccountBalance() {
        return accountBalance;
    }

    public void setAccountBalance(Long accountBalance) {
        this.accountBalance = accountBalance;
    }

    public String getIsMobileCheck() {
        return isMobileCheck;
    }

    public void setIsMobileCheck(String isMobileCheck) {
        this.isMobileCheck = isMobileCheck;
    }

    public String getIsEmailCheck() {
        return isEmailCheck;
    }

    public void setIsEmailCheck(String isEmailCheck) {
        this.isEmailCheck = isEmailCheck;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(Integer userLevel) {
        this.userLevel = userLevel;
    }

    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    public Integer getExperienceValue() {
        return experienceValue;
    }

    public void setExperienceValue(Integer experienceValue) {
        this.experienceValue = experienceValue;
    }
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public User() {
    }

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public User(String phone, String email, String nickName, String name, String sex, Date birthday) {
        this.phone = phone;
        this.email = email;
        this.nickName = nickName;
        this.name = name;
        this.sex = sex;
        this.birthday = birthday;
    }

    public User(String username, String phone, String email, String nickName, String name, String sex) {
        this.username = username;
        this.phone = phone;
        this.email = email;
        this.nickName = nickName;
        this.name = name;
        this.sex = sex;
    }

    public User(String phone, String email, String nickName, String name, String sex) {
        this.phone = phone;
        this.email = email;
        this.nickName = nickName;
        this.name = name;
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", email='" + email + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", sourceType='" + sourceType + '\'' +
                ", nickName='" + nickName + '\'' +
                ", name='" + name + '\'' +
                ", status='" + status + '\'' +
                ", headPic='" + headPic + '\'' +
                ", qq='" + qq + '\'' +
                ", accountBalance=" + accountBalance +
                ", isMobileCheck='" + isMobileCheck + '\'' +
                ", isEmailCheck='" + isEmailCheck + '\'' +
                ", sex='" + sex + '\'' +
                ", userLevel=" + userLevel +
                ", points=" + points +
                ", experienceValue=" + experienceValue +
                ", birthday=" + birthday +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }
}